package com.bootcamp.s3_1013.database._1019_JBUtils;

import com.bootcamp.s3_1013.database.utils.DruidUtils;
import org.apache.commons.dbutils.QueryRunner;

import java.sql.SQLException;

/**
 * @program: myClassCode
 * @description: data bses utils
 * @author: Keyu Li
 * @create: 2021-10-19 11:24
 **/

public class Demo2_DBUtils {
    public static void main(String[] args) {
        queryRunnerDemo();
    }

    private static void queryRunnerDemo() {
        QueryRunner queryRunner = new QueryRunner(DruidUtils.getDataSource());
        try {
            queryRunner.update("update emp set sal=5000 where empno=7");
        } catch (SQLException throwables) {
            throwables.printStackTrace();
        }

    }
}
